package com.easy.system.util;

import javax.servlet.http.HttpServletRequest;

/**
 * Created with IntelliJ IDEA.
 * User: sunguangzhu
 * Date: 13-7-2
 * Time: 上午10:59
 * To change this template use File | Settings | File Templates.
 */
public class RequestVarsUtil {
    public static Pagination getPagination(HttpServletRequest request) {

        int page = 0;
        int pageSize = 2;
        if (request.getParameter("page") != null && !request.getParameter("page").equals("")) {
            page = Integer.valueOf(request.getParameter("page"));
        }
        if (request.getParameter("rows") != null && !request.getParameter("rows").equals("")) {
            pageSize = Integer.valueOf(request.getParameter("rows"));
        }
             /*if(null!=request.getParameter("order")) {

                 order=request.getParameter("order").toString();

             }

             if(null!=request.getParameter("sort")) {

                 order=request.getParameter("sort").toString();

             }*/
        Pagination pagination = new Pagination(page, pageSize);
        return pagination;
    }

}
